<template>
    <div>
        <div class="JKiyc">
        <ul class="nav">
            <li>
                <router-link :to="{path:'/'}" class="fontsD nav_flex" @click="addClass('/')">
                    <div class="navicon navHome" :class="{HomeActive:'/' === $route.path}"></div>
                    <p class="fontsD" :class="{activecolor:'/' === $route.path}">首页</p>
                </router-link>
            </li>
            <li>
                <router-link :to="{path:'/Hospital'}" class="fontsD nav_flex" @click="addClass('/Hospital')">
                    <div class="navicon navHos" :class="{HosActive:'/Hospital' === $route.path}"></div>
                    <p class="fontsD" :class="{activecolor:'/Hospital' === $route.path}">医疗</p>
                </router-link>
            </li>
            <li>
                <router-link :to="{path:'/Health'}" class="fontsD nav_flex" @click="addClass('/Health')">
                    <div class="navicon navnoctice" :class="{nocticeActive:'/Health' === $route.path}"></div>
                    <p class="fontsD" :class="{activecolor:'/Health' === $route.path}">健康</p>
                </router-link>
            </li>
            <li>
                <router-link :to="{path:'/profile'}" class="fontsD nav_flex" @click="addClass('/profile')">
                    <div class="navicon navPro" :class="{ProActive:'/profile' === $route.path}"></div>
                    <p class="fontsD" :class="{activecolor:'/profile' === $route.path}">我的</p>
                </router-link>
            </li>
        </ul>
        </div>
    </div>
</template>

<script>

export default {
  data () {
    return {
    }
  },
  methods: {
    addClass (path) {
      this.$router.replace(path)
    }
  }
}

</script>

<style scoped>
.nav {
    display: flex;
    width: 100%;
}
.navicon {
    width: 0.5rem;
    height: 0.5rem;

}
.nav_flex {
    display: flex;
    align-items: center;
    flex-direction:column;
}
/* 首页 */
.navHome {
    background: url(../assets/img/Home.png) no-repeat center center;
    background-size: 100%;
}
.HomeActive {
    background: url(../assets/img/HomeActive.png) no-repeat center center;
    background-size: 100%;
}

/* 医疗 */
.navHos {
    background: url(../assets/img/Hospital.png) no-repeat center center;
    background-size: 100%;
}
.HosActive {
    background: url(../assets/img/HospitalActive.png) no-repeat center center;
    background-size: 100%;
}
/* 消息 */
.navnoctice {
    background: url(../assets/img/Health.png) no-repeat center center;
    background-size: 100%;
}
.nocticeActive {
    background: url(../assets/img/HealthActive.png) no-repeat center center;
    background-size: 100%;
}
/* 我的 */
.navPro {
    background: url(../assets/img/Profile.png) no-repeat center center;
    background-size: 100%;
}
.ProActive {
    background: url(../assets/img/ProfileActive.png) no-repeat center center;
    background-size: 100%;
}
.nav li {
    flex: 1;
    font-size: 0.2rem;
    padding-top: 0.1rem;
}
.JKiyc {
    width: 100%;
    height: 1rem;
    position: fixed;
    bottom: 0;
    left: 0;
    /* background: #f5f5f5; */
    z-index: 999;
    background: #fefefe;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}
</style>
